import { getRankList } from "@/api/user";

export default {
    namespaced: true,
    state: {
        userInfo: null,
        userRankList: null,
    },
    mutations: {
        // setUserInfo(state, data) {
        //     state.userInfo = data;
        // },
        // clearUserInfo(state) {
        //     state.userInfo = null;
        // },
        setuserRankList(state, data) {
            state.userRankList = data
        },
    },
    actions: {
        // async getUserInfo({ commit }) {
        //     const { code, data} = await this.getUserInfo()
        //     if (+code === 200) {
        //         commit('setUserInfo', data);
        //         return Promise.resolve(data);
        //     }
        // },
        async getUserRank({ commit }) {
            console.log('Hello')
            const data = await getRankList();
            commit('setuserRankList', data);
        }
    }
}